﻿namespace EMall.Domain
{
    public interface IRepository { }
    public interface IRepository<TAggregateRoot> : IRepository where TAggregateRoot : class, IAggregateRoot
    {
        void Add(TAggregateRoot entity);
        Task AddAsync(TAggregateRoot entity);
        void Remove(TAggregateRoot entity);
        Task RemoveAsync(TAggregateRoot entity);
        IQueryable<TAggregateRoot> GetQueryable();
        int Count();
        Task<int> CountAsync();
    }
    public interface IRepository<TAggregateRoot, TKey> : IRepository<TAggregateRoot> where TAggregateRoot : class, IAggregateRoot<TKey>
    {
        TAggregateRoot Get(TKey id);
        Task<TAggregateRoot> GetAsync(TKey id);
    }
}
